import { createRouter, createWebHashHistory, Router } from 'vue-router'
import constantRoutes from './modules/constantRoutes'

const base = "/"

let router: Router = createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ top: 0 }),
  routes: constantRoutes
})

export const resetRouter = () => {
  const newRouter = createRouter({
    history: createWebHashHistory(),
    scrollBehavior: () => ({ top: 0 }),
    routes: constantRoutes
  })
  router = newRouter // reset router
}


export default router